package com.getword.utils;

import org.springframework.util.ResourceUtils;

import java.io.FileNotFoundException;

public class PathUtil {
    public static String basePath;   // target/classes/

    static {
        try {
            basePath = ResourceUtils.getURL("classpath:").getPath();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    // 不包含.
    public static String getFileExt(String filename) {
        return filename.substring(filename.lastIndexOf(".") + 1);
    }
}
